import React, { Fragment } from 'react';
import { View, Text } from 'react-native';
import { List } from 'antd-mobile';
import { phonecall } from 'react-native-communications';
import styles from './style';
import { addStars } from '../../../../utils';

const ListItem = List.Item;

export default ({ data }) => {
  const { educationTypeName, jobTypeName, intimateDegree, annualSalary, mobile, idCardNo } = data
  const makeCall = () => {
    phonecall(mobile, false)
  }
  return (
    <Fragment>
      <View style={styles.infoWrap}>
        <List>
          <ListItem extra={educationTypeName || '--'}>学历</ListItem>
          <ListItem extra={jobTypeName || '--'}>职业</ListItem>
          <ListItem extra={intimateDegree || '--'}>关系评分</ListItem>
          <ListItem extra={annualSalary || '--'}>年收入(万元)</ListItem>
        </List>
      </View>
      <View style={styles.infoWrap}>
        <List>
          <ListItem extra={<Text style={{ color: '#3399ff' }} onPress={makeCall}>{addStars(mobile, 3, 6) || '--'}</Text>}>手机号</ListItem>
          <ListItem extra={addStars(idCardNo, 0, 13) || '--'}>身份证号</ListItem>
        </List>
      </View>
    </Fragment>
  );
};
